switch (argument0)
{
    case "idle":
        self.image_index = 0
        self.image_speed = 0
        break;
    case "walking":
        self.image_speed = 0.5
        break;
    default:
        show_debug_message("WARNING: Modify state (user def 0) called on"
            + " AI with invalid state (" + argument0 + ").");
}

self.state = argument0; //Script finished successfully, set state var.
 
